package com.oyo.common.enums;

/**
 * @Author: sangbowei
 * @Description:
 * @Date: 2018/8/31 14:55
 */
public enum UnionMasterType {

    IS_NOT_UNION_MASTER(0, "非主联房"),
    IS_UNION_MASTER(1, "主联房");

    int code;
    String name;

    UnionMasterType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(int code) {
        UnionMasterType[] types = values();
        for (UnionMasterType type : types) {
            if (type.getCode() == code) {
                return type.getName();
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

}
